import { App } from 'vue'

export default (app: App): void => {
  const requireComponents = require.context('@/layouts/components', true, /\.vue$/)
  requireComponents.keys().forEach(fileName => {
    const componentConfig = requireComponents(fileName)
    const componentName = componentConfig.default.name
    app.component(componentName, componentConfig.default || componentConfig)
  })
}
